;Product Info
Name "Opera History Component" ;Define your own software name here
!define PRODUCT "Opera History Component" ;Define your own software name here
!define VERSION "1.0" ;Define your own software version here

; Script create for version 2.0rc1/final (from 12.jan.04) with GUI NSIS (c) by Dirk Paehl. Thank you for use my program

 !include "MUI.nsh"

 
;--------------------------------
;Configuration
 
   OutFile "setup.exe"
BRANDINGTEXT "Straw Dogs"

  ;Folder selection page
   InstallDir "$PROGRAMFILES\${PRODUCT}"

;Remember install folder
InstallDirRegKey HKCU "Software\${PRODUCT}" ""

;--------------------------------
;Pages
  !insertmacro MUI_PAGE_DIRECTORY
  !insertmacro MUI_PAGE_INSTFILES
  !insertmacro MUI_PAGE_FINISH
  !insertmacro MUI_UNPAGE_CONFIRM
  !insertmacro MUI_UNPAGE_INSTFILES

 !define MUI_ABORTWARNING

 
;--------------------------------
 ;Language
 
  !insertmacro MUI_LANGUAGE "English"
;--------------------------------

     
Section "section_1" section_1
SetOutPath "$INSTDIR"
FILE "C:\Documents and Settings\Ashiro Dao\My Documents\Visual Studio Projects\OperaHistoryComponent\bin\Debug\readme.txt"
FILE "C:\Documents and Settings\Ashiro Dao\My Documents\Visual Studio Projects\OperaHistoryComponent\bin\Debug\Interop.GoogleDesktopAPILib.dll"
FILE "C:\Documents and Settings\Ashiro Dao\My Documents\Visual Studio Projects\OperaHistoryComponent\bin\Debug\OperaHistoryComponent.exe"
SectionEnd

Section Shortcuts
CreateDirectory "$SMPROGRAMS\Opera History Component"
  WriteIniStr "$INSTDIR\Opera History Component.url" "InternetShortcut" "URL" "http://www.straw-dogs.co.uk"
  CreateShortCut "$SMPROGRAMS\Opera History Component\Opera History Component.lnk" "$INSTDIR\Opera History Component.url" "" "$INSTDIR\Opera History Component.url" 0
  CreateShortCut "$SMPROGRAMS\Opera History Component\Register.lnk" "$INSTDIR\OperaHistoryComponent.exe" "-register" "$INSTDIR\Opera History Component.url" 0
  CreateShortCut "$SMPROGRAMS\Opera History Component\UnRegister.lnk" "$INSTDIR\OperaHistoryComponent.exe" "-unregister" "$INSTDIR\Opera History Component.url" 0
  CreateShortCut "$SMPROGRAMS\Opera History Component\Start OHC.lnk" "$INSTDIR\OperaHistoryComponent.exe" "" "$INSTDIR\Opera History Component.url" 0
SectionEnd

Section Uninstaller
  CreateShortCut "$SMPROGRAMS\Opera History Component\Uninstall.lnk" "$INSTDIR\uninst.exe" "" "$INSTDIR\uninst.exe" 0
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Opera History Component" "DisplayName" "${PRODUCT} ${VERSION}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Opera History Component" "DisplayVersion" "${VERSION}"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Opera History Component" "URLInfoAbout" "http://www.straw-dogs.co.uk"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Opera History Component" "Publisher" "Ashiro Doug Bromley"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Opera History Component" "UninstallString" "$INSTDIR\Uninst.exe"
  WriteRegStr HKCU "Software\${PRODUCT}" "" $INSTDIR
  WriteUninstaller "$INSTDIR\Uninst.exe"
 
 
SectionEnd
 
 
Function un.onUninstSuccess
  HideWindow
  MessageBox MB_ICONINFORMATION|MB_OK "$(^Name) was successfully removed from your computer.."
FunctionEnd
  
Function un.onInit 
  MessageBox MB_ICONQUESTION|MB_YESNO|MB_DEFBUTTON2 "Are you sure you want to completely remove $(^Name) and all of its components?" IDYES +2
  Abort
FunctionEnd
 
Section "Uninstall" 

  ExecWait '"$INSTDIR\OperaHistoryComponent.exe" -unregister'   
  Delete "$SMPROGRAMS\Opera History Component\*.*"
  RmDir "$SMPROGRAMS\Opera History Component"
  DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Opera History Component"
  DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Opera History Component"
  Delete "$INSTDIR\*.*"
  RMDir "$INSTDIR"
             
SectionEnd
               
   
Function .onInstSuccess
   Exec '"$INSTDIR\OperaHistoryComponent.exe" -register'
FunctionEnd
;eof
